package com.sfac.modules.test.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sfac.modules.common.pojo.AbstractEntity;
import lombok.Data;
import org.aspectj.lang.annotation.DeclareAnnotation;

import javax.persistence.*;
import java.util.List;


@Data
@Entity
@Table(name = "test_clazz")
public class Clazz extends AbstractEntity {
    private String clazzName;

    @ManyToMany(cascade = CascadeType.ALL)
    @JoinTable(name = "test_clazz_student",
            joinColumns = @JoinColumn(name = "clazz_id"),
            inverseJoinColumns = @JoinColumn(name = "student_id")
            )
    private List<Student> students;

    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "school_id" ,unique = true)
    @JsonIgnore
    private School school;


}
